<!DOCTYPE html>



  


<html class="theme-next gemini use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, 
maximum-scale=1">
<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<meta name="theme-color" content="#222">

<script>
    (function () {
        if ('') {
            if (prompt('请输入文章密码') !== '') {
                alert('密码错误！');
                if (history.length === 1) {
                    location.replace("http://xxxxxxx.xxx"); // 这里替换成你的首页
                } else {
                    history.back();
                }
            }
        }
    })();
</script>


  
  
    
    
  <script src="/lib/pace/pace.min.js?v=1.0.2"></script>
  <link href="/lib/pace/pace-theme-minimal.min.css?v=1.0.2" rel="stylesheet">







<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="algorithm,">










<meta name="description" content="多线程下的游戏循环假定对每个游戏来讲，渲染整个场景需要30ms,它还需要额外的20ms去更新游戏世界。如果这些都在同一个线程执行，每帧将耗时50ms,最终导致降低帧率–20FPS，这是不可接受的。但如果渲染和更新逻辑同步执行，每帧只要30ms，30FPS的目标就可以完成。主线程必须区里所有输入、更新游戏世界、处理所有图形以外的输出。它必须提交相关数据给第二条线程，那么第二条线程就可以渲染所有图像。">
<meta name="keywords" content="algorithm">
<meta property="og:type" content="article">
<meta property="og:title" content="游戏编程算法与技巧-读书笔记（一）">
<meta property="og:url" content="http://sabistian.cn/2019/11/23/读书笔记/index.html">
<meta property="og:site_name" content="Sabistian    |      Dear">
<meta property="og:description" content="多线程下的游戏循环假定对每个游戏来讲，渲染整个场景需要30ms,它还需要额外的20ms去更新游戏世界。如果这些都在同一个线程执行，每帧将耗时50ms,最终导致降低帧率–20FPS，这是不可接受的。但如果渲染和更新逻辑同步执行，每帧只要30ms，30FPS的目标就可以完成。主线程必须区里所有输入、更新游戏世界、处理所有图形以外的输出。它必须提交相关数据给第二条线程，那么第二条线程就可以渲染所有图像。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2.6.png">
<meta property="og:image" content="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2-5.png">
<meta property="og:image" content="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2-6.png">
<meta property="og:image" content="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2-7.png">
<meta property="og:updated_time" content="2019-11-29T17:46:12.634Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="游戏编程算法与技巧-读书笔记（一）">
<meta name="twitter:description" content="多线程下的游戏循环假定对每个游戏来讲，渲染整个场景需要30ms,它还需要额外的20ms去更新游戏世界。如果这些都在同一个线程执行，每帧将耗时50ms,最终导致降低帧率–20FPS，这是不可接受的。但如果渲染和更新逻辑同步执行，每帧只要30ms，30FPS的目标就可以完成。主线程必须区里所有输入、更新游戏世界、处理所有图形以外的输出。它必须提交相关数据给第二条线程，那么第二条线程就可以渲染所有图像。">
<meta name="twitter:image" content="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2.6.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://sabistian.cn/2019/11/23/读书笔记/">





  <title>游戏编程算法与技巧-读书笔记（一） | Sabistian    |      Dear</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Sabistian    |      Dear</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            归档
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://sabistian.cn/2019/11/23/读书笔记/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="邱灵雨">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/headicon.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Sabistian    |      Dear">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">游戏编程算法与技巧-读书笔记（一）</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2019-11-23T23:03:09+08:00">
                2019-11-23
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/杂项/" itemprop="url" rel="index">
                    <span itemprop="name">杂项</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="多线程下的游戏循环"><a href="#多线程下的游戏循环" class="headerlink" title="多线程下的游戏循环"></a>多线程下的游戏循环</h2><p>假定对每个游戏来讲，渲染整个场景需要30ms,它还需要额外的20ms去更新游戏世界。如果这些都在同一个线程执行，每帧将耗时50ms,最终导致降低帧率–20FPS，这是不可接受的。但如果渲染和更新逻辑同步执行，每帧只要30ms，30FPS的目标就可以完成。<br>主线程必须区里所有输入、更新游戏世界、处理所有图形以外的输出。它必须提交相关数据给第二条线程，那么第二条线程就可以渲染所有图像。渲染线程绘制的时候，主线程该干什么？让渲染线程比主线程慢一帧。</p>
<a id="more"></a> 
<p>增量时间的出现，避免了固定帧率导致固定循环次数运行在不同设备上的出现的Bug</p>
<p>输入延迟，第二帧按下。在多线程游戏循环下，输入直到第三帧才开始处理，图形要到第4帧结束之后才能看到，如图所示。<br><img src="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2.6.png" alt="2-6"></p>
<p>C++中的钻石问题与解决方案</p>
<p>菱形继承<br>虽然有很多解决方案，但是通常要尽量避免，除非有很好的理由这么做。<br><img src="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2-5.png" alt="2-5"></p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Tiger</span> :</span> <span class="keyword">virtual</span> <span class="keyword">public</span> Animal &#123; <span class="comment">/* ... */</span> &#125;;</span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Lion</span> :</span> <span class="keyword">virtual</span> <span class="keyword">public</span> Animal &#123; <span class="comment">/* ... */</span> &#125;</span><br></pre></td></tr></table></figure>

<p>这种写法在当有类C同时继承这两种之后就不会出现两个Animal类对象了</p>
<p>真实时间和游戏时间-子弹时间，一盘篮球游戏的时间</p>
<p>##游戏循环中的游戏对象</p>
<p>一个基础的游戏对象GameObject</p>
<p>任何游戏对象公有的功能，不管什么对象类型，都应该放在基类里。这样就可以声明两个接口，一个是Drawable对象，一个是Updateable对象。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">interface Drawable</span><br><span class="line">    <span class="function">function <span class="title">Draw</span><span class="params">()</span></span></span><br><span class="line"><span class="function">end</span></span><br><span class="line"><span class="function"></span></span><br><span class="line"><span class="function">Updateable</span></span><br><span class="line"><span class="function">    function <span class="title">Update</span><span class="params">(<span class="keyword">float</span> deltaTime)</span></span></span><br><span class="line"><span class="function">end</span></span><br></pre></td></tr></table></figure>

<p>就可以这两个接口和一个基类来表示3种游戏对象<br>只更新的对象</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">UGameObject</span> <span class="title">inherits</span> <span class="title">GameObject</span>,<span class="title">implements</span> <span class="title">Updateable</span></span></span><br></pre></td></tr></table></figure>

<p>只渲染的对象</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">DGameObject</span> <span class="title">inherits</span> <span class="title">GameObject</span>,<span class="title">implements</span> <span class="title">Drawable</span></span></span><br></pre></td></tr></table></figure>

<p>更新且绘制的游戏对象</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">DUGameObject</span> <span class="title">inherits</span> <span class="title">UGameObject</span>,<span class="title">implements</span> <span class="title">Drawable</span></span></span><br></pre></td></tr></table></figure>

<p>这里没有直接继承DGameObject 和 UGameObject就是避免了钻石问题</p>
<p>实现这三种对象之后，把它们整合在游戏循环中是很简单的。GameWorld类拥有两个列表,分别在游戏世界中管理Updateable对象和Drawable对象</p>
<p>强制锁定30FPS的帧率 将targetFrameTime = 33.3f</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line">targetFrameTime = <span class="number">33.3f</span></span><br><span class="line"><span class="keyword">while</span> game is running</span><br><span class="line">      realDeltaTime = time since last frame</span><br><span class="line">      gameDeltaTime = realDeltaTime * gameTimeFactor</span><br><span class="line">      </span><br><span class="line">      <span class="comment">//处理输入</span></span><br><span class="line">      ...</span><br><span class="line">      update game world with gameDeltaTime</span><br><span class="line">      </span><br><span class="line">      <span class="comment">//渲染输出</span></span><br><span class="line">      ...</span><br><span class="line">      </span><br><span class="line">      <span class="keyword">while</span>(time spent <span class="keyword">this</span> frame &lt; targetFrameTime)</span><br><span class="line">        </span><br><span class="line">        ...</span><br><span class="line">      loop</span><br><span class="line">loop</span><br></pre></td></tr></table></figure>

<h2 id="2D渲染基础"><a href="#2D渲染基础" class="headerlink" title="2D渲染基础"></a>2D渲染基础</h2><p>对于屏幕撕裂<br>喷枪在屏幕上绘制到一半时，刚好游戏循环到了”generater outputs”阶段。它开始为新的一帧往像素缓冲区写像素时，CRT还在上一帧的绘制过程中。</p>
<p>一个解决方案就是同步游戏循环，等到场消隐期在开始渲染。这样会消除分裂图像的问题，但是它限制了游戏循环的间隔，只有场消隐期间才能进行渲染，对于现在的游戏来说是不行的。</p>
<p>另一个解决方案叫作双缓冲技术。双缓冲技术里，有两块像素缓冲区。游戏交替地绘制在这两块缓冲区里。在一帧内，游戏循环可能将颜色写入缓冲区A，而CRT正在显示缓冲区B。到了下一帧CRT显示缓冲区A，而游戏循环写入缓冲区B。由于CRT和游戏循环都在使用不同的缓冲区，所以没有CRT绘制不完整的风险。</p>
<p>缓冲区交换要放在场消隐期进行。</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="function">function <span class="title">RenderWorld</span><span class="params">()</span></span></span><br><span class="line"><span class="function">    <span class="comment">// 绘制游戏世界中所有对象</span></span></span><br><span class="line">    ...</span><br><span class="line">    wait <span class="keyword">for</span> VBLANK</span><br><span class="line">    swap color buffers</span><br><span class="line">end</span><br></pre></td></tr></table></figure>

<p>绘制精灵的算法<br>绘制方式先画背景色后画角色。这就像画家在画布上画画一样，也因为这样，这个算法叫做<strong>画家算法</strong>。在画家算法中，所有精灵是从后往前排序的，如下图所示。当它绘制场景时预先排好序的场景可以直接遍历渲染，得到正确的结果。<br><img src="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2-6.png" alt="2-7"></p>
<p>画家算法也可以运用在3D环境下，但它有很多缺陷。而在2D场景中，画家算法工作得很好。</p>
<p>为了保证动画的连续性，帧率最少要达到24FPS</p>
<p>用一组图片去表示一个角色所有状态，一个有走动和跑步的角色，每个用10帧表示，总共用了20张图片。顺序存储也就是0-9帧表示走路,10-19帧表示跑步<br><img src="https://sabistianblogimg.oss-cn-beijing.aliyuncs.com/2-7.png" alt="2-8"></p>
<p>AnimatedSprite 要能够跟踪当前的动画数量，知道当前帧属于哪一个动画及当前动画需要用到多长时间，FPS也作为成员变量被存储了。可以通过修改FPS来让动画动态加速或减速。角色获得加速效果，让角色跑动的快一点</p>
<figure class="highlight c++"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">AnimatedSprite</span> <span class="title">inherits</span> <span class="title">Sprite</span></span></span><br><span class="line"><span class="class">    //所有动画数据</span></span><br><span class="line"><span class="class">    <span class="title">AnimData</span> <span class="title">animData</span></span></span><br><span class="line"><span class="class">    //当前运行中的动画</span></span><br><span class="line"><span class="class">    <span class="title">int</span> <span class="title">animNum</span></span></span><br><span class="line"><span class="class">    //当前帧播放了多长时间</span></span><br><span class="line"><span class="class">    <span class="title">int</span> <span class="title">frameNum</span></span></span><br><span class="line"><span class="class">    //</span></span><br><span class="line"><span class="class">    <span class="title">float</span> <span class="title">frameTime</span></span></span><br><span class="line"><span class="class">    <span class="title">float</span> <span class="title">animFPS</span> = 24.0<span class="title">f</span></span></span><br><span class="line"><span class="class">    </span></span><br><span class="line"><span class="class">    <span class="title">function</span> <span class="title">Initialize</span>(<span class="title">AnimData</span> <span class="title">myData</span>,<span class="title">int</span> <span class="title">startingAnimNum</span>)</span></span><br><span class="line"><span class="class">    <span class="title">function</span> <span class="title">UpdateAnim</span>(<span class="title">float</span> <span class="title">deltaTime</span>)</span></span><br><span class="line"><span class="class">    <span class="title">function</span> <span class="title">ChangeAnim</span>(<span class="title">int</span> <span class="title">num</span>)</span></span><br></pre></td></tr></table></figure>


      
    </div>
    
    
    

    

    
      <div>
        <div style="padding: 10px 0; margin: 20px auto; width: 90%; text-align: center;">
  <div></div>
  <button id="rewardButton" disable="enable" onclick="var qr = document.getElementById('QR'); if (qr.style.display === 'none') {qr.style.display='block';} else {qr.style.display='none'}">
    <span>打赏</span>
  </button>
  <div id="QR" style="display: none;">

    
      <div id="wechat" style="display: inline-block">
        <img id="wechat_qr" src="/images/wechatpay.jpg" alt="邱灵雨 微信支付">
        <p>微信支付</p>
      </div>
    

    
      <div id="alipay" style="display: inline-block">
        <img id="alipay_qr" src="/images/alipay.jpg" alt="邱灵雨 支付宝">
        <p>支付宝</p>
      </div>
    

    

  </div>
</div>

      </div>
    

    
      <div>
        
      <ul class="post-copyright">
         <li class="post-copyright-link">
          <strong>本文作者：</strong>
          <a href="/" title="欢迎访问 邱灵雨 的个人博客">邱灵雨</a>
        </li>

        <li class="post-copyright-link">
          <strong>本文链接：</strong>
          <a href="http://sabistian.cn/2019/11/23/读书笔记/" title="游戏编程算法与技巧-读书笔记（一）">http://sabistian.cn/2019/11/23/读书笔记/</a>
        </li>

        <li class="post-copyright-license">
          <strong>版权声明： </strong>
          本文由 邱灵雨 原创，采用 <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh" rel="license" target="_blank">保留署名-非商业性使用-禁止演绎 4.0-国际许可协议</a> <br>转载请保留以上声明信息！
        </li>
      </ul>
<div style="text-align:center;color: #ccc;font-size:14px;">
------ 本文结束 ------</div>
      </div>
    

    <footer class="post-footer">
      
      
        <div class="post-tags">
          
            <a href="/tags/algorithm/" rel="tag"><i class="fa fa-tag"></i> algorithm</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2019/11/19/LinuxInstructions-3/" rel="next" title="Linux常用指令（三）">
                <i class="fa fa-chevron-left"></i> Linux常用指令（三）
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2019/12/01/高性能MySQL读书笔记(四)/" rel="prev" title="高性能MySQL读书笔记（四）">
                高性能MySQL读书笔记（四） <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/headicon.png" alt="邱灵雨">
            
              <p class="site-author-name" itemprop="name">邱灵雨</p>
              <p class="site-description motion-element" itemprop="description">灵雨既零</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">21</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">20</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/sabistian" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="mailto:sebistian@163.com" target="_blank" title="Mail">
                      
                        <i class="fa fa-fw fa-envelope"></i>Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/5975979965/profile?rightmod=1&wvr=6&mod=personinfo" target="_blank" title="Weibo">
                      
                        <i class="fa fa-fw fa-weibo"></i>Weibo</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/kuai-shen-l/activities" target="_blank" title="ZhiHu">
                      
                        <i class="fa fa-fw fa-globe"></i>ZhiHu</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#多线程下的游戏循环"><span class="nav-number">1.</span> <span class="nav-text">多线程下的游戏循环</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#2D渲染基础"><span class="nav-number">2.</span> <span class="nav-text">2D渲染基础</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>

<div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">邱灵雨</span>

  
</div>

<div class="powered-by">
<i class="fa fa-user-md"></i><span id="busuanzi_container_site_uv">
  本站访客数:<span id="busuanzi_value_site_uv"></span>
</span>
</div>


  <div class="powered-by">由 <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a> 强力驱动</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Gemini</a> v5.1.4</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.4"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  

  

  

</body>
</html>
